#include "progressbar.h"

const char* lable="|/-\\";
void progress()
{
    char buffer[MAX];
    memset(buffer,'\0',sizeof(buffer));
    int count=0;
    int n=strlen(lable);
    buffer[0]=Head;
    while(count<=100)
    {
        printf("[%-100s][%d%%][%c]\r",buffer,count,lable[count%n]);
        fflush(stdout);
        buffer[count++]=Body;
        buffer[count]=Head;//把下一个变成>
        usleep(50000);
    }
    printf("\n");
}
